<script src="/js/jquery-1.11.1.min.js"></script>
<script src="/js/12306test-2.1.js"></script>
<!-- <p id ="test"></p> -->
<table style="margin-left: 10px;margin-top: 10px;">
	<tr>
		<td colspan='2'><div id="wb_validate"></div></td>
	</tr>
	<tr>
		<td colspan='2'><button onclick="submit()">确认</button>&nbsp;<span id="message"></span></td>
	</tr>
</table>
<script>
var img = getContextPath()+"/img/trian.png";
var defaluts = {
	api:getContextPath()+'/verifiy',
	select:"<img src="+img+" />"
};
function submit(){
	$.fn.validate.submit($("#wb_validate"),getContextPath()+"/verifiy",{},function(status){
		if(status=='SUCCESS'){
			$("#message").html('<font color="green">验证成功</font>');
		}else{
			$("#message").html('<font color="red">验证失败</font>');
			setTimeout($.fn.validate.reflush("wb_validate"), 5000);
		}
	});
}
$(document).ready(function(){
	$("#wb_validate").validate();
});
function getContextPath() {
    var pathName = document.location.pathname;
    var index = pathName.substr(1).indexOf("/");
    var result = pathName.substr(0,index+1);
    return result;
}
</script>
